Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

Support UnknownProperties and GroupMembership#438

Merged
rfc2822 merged 9 commits into
mainfrom
422-contacts-rewrite-provide-all-davx-functionality-in-synctools
May 25, 2026
Merged

Support UnknownProperties and GroupMembership#438
rfc2822 merged 9 commits into
mainfrom
422-contacts-rewrite-provide-all-davx-functionality-in-synctools

Conversation

@rfc2822

@rfc2822 rfc2822 commented May 22, 2026

Copy link
Copy Markdown
Member

Closes #422. Corresponding DAVx⁵ PR: bitfireAT/davx5-ose#2244

A bit hard to review, but it's mostly moved code from DAVx5 LocalAddressBook/LocalContact to AndroidAddressBook/AndroidContact so that we don't have to define custom handlers/builders in DAVx5. This makes it easier to refactor everything because it can be done directly in synctools.

@rfc2822 rfc2822 self-assigned this May 22, 2026
@rfc2822 rfc2822 requested a review from Copilot May 22, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves contact group-membership and unknown-property handling into synctools (so DAVx⁵ no longer needs custom contact handlers/builders), adding the missing storage contracts, mapping handlers/builders, and minimal address book/group utilities to support it.

Changes:

  • Add support for storing/reading unknown vCard properties for contacts via a new contacts data-row contract, handler, and builder.
  • Add group-membership + cached group-membership handling via new contracts/handlers/builders and AndroidContact helper methods.
  • Extend AndroidAddressBook with findOrCreateGroup() and wire new handlers/builders into AndroidContact.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
lib/src/main/kotlin/at/bitfire/synctools/util/SensitiveString.kt Update license header.
lib/src/test/kotlin/at/bitfire/synctools/util/SensitiveStringTest.kt Update license header.
lib/src/main/kotlin/at/bitfire/synctools/storage/contacts/UnknownPropertyContract.kt New contract for persisting unknown vCard properties on contacts.
lib/src/main/kotlin/at/bitfire/synctools/storage/contacts/CachedGroupMembershipContract.kt Rename/expand cached group membership contract with docs/constants.
lib/src/main/kotlin/at/bitfire/synctools/storage/contacts/AndroidAddressBook.kt Add groupMethod + findOrCreateGroup() helper.
lib/src/main/kotlin/at/bitfire/synctools/storage/contacts/AndroidContact.kt Wire new handlers/builders; add group-membership management APIs.
lib/src/main/kotlin/at/bitfire/synctools/mapping/contacts/RawContactHandler.kt Restrict handler registration API visibility.
lib/src/main/kotlin/at/bitfire/synctools/mapping/contacts/RawContactBuilder.kt Restrict builder registration API visibility.
lib/src/main/kotlin/at/bitfire/synctools/mapping/contacts/handler/UnknownPropertiesHandler.kt New contacts handler to read unknown properties from the provider.
lib/src/main/kotlin/at/bitfire/synctools/mapping/contacts/builder/UnknownPropertiesBuilder.kt New builder to write unknown properties to the provider.
lib/src/test/kotlin/at/bitfire/synctools/mapping/contacts/handler/UnknownPropertiesHandlerTest.kt New unit test for unknown-properties handler (currently has incorrect import).
lib/src/test/kotlin/at/bitfire/synctools/mapping/contacts/builder/UnknownPropertiesBuilderTest.kt New unit test for unknown-properties builder.
lib/src/main/kotlin/at/bitfire/synctools/mapping/contacts/handler/GroupMembershipHandler.kt New handler to read group memberships (+ categories when configured).
lib/src/main/kotlin/at/bitfire/synctools/mapping/contacts/handler/CachedGroupMembershipHandler.kt New handler to read cached group memberships.
lib/src/main/kotlin/at/bitfire/synctools/mapping/contacts/builder/GroupMembershipBuilder.kt New builder to write group memberships from categories (CATEGORIES mode).
lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/contacts/handler/GroupMembershipHandlerTest.kt Instrumentation tests for group membership handler.
lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/contacts/handler/CachedGroupMembershipHandlerTest.kt Instrumentation tests for cached membership handler.
lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/contacts/builder/GroupMembershipBuilderTest.kt Instrumentation tests for group membership builder.
Comments suppressed due to low confidence (1)

lib/src/main/kotlin/at/bitfire/synctools/storage/contacts/CachedGroupMembershipContract.kt:11

  • todo: Remove unused self-import

import at.bitfire.synctools.storage.contacts.CachedGroupMembershipContract.MIMETYPE is unused (the KDoc link [MIMETYPE] resolves without it). Dropping it avoids compiler warnings and keeps imports tidy.

Comment thread lib/src/main/kotlin/at/bitfire/synctools/storage/contacts/AndroidContact.kt Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

lib/src/main/kotlin/at/bitfire/synctools/storage/contacts/CachedGroupMembershipContract.kt:11

  • todo: Remove unused import

import at.bitfire.synctools.storage.contacts.CachedGroupMembershipContract.MIMETYPE is unused (the KDoc reference doesn’t require the import).

@rfc2822 rfc2822 marked this pull request as ready for review May 22, 2026 15:02
@rfc2822 rfc2822 requested a review from ArnyminerZ May 22, 2026 15:06

@ArnyminerZ ArnyminerZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say looks good to me, kind of hard, but reviewed by looking back and forth between bitfireAT/davx5-ose#2244 and this.

@rfc2822 rfc2822 merged commit 1fb67fb into main May 25, 2026
9 checks passed
@rfc2822 rfc2822 deleted the 422-contacts-rewrite-provide-all-davx-functionality-in-synctools branch May 25, 2026 10:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Contacts rewrite] Provide group membership and unknown property functionality in synctools

3 participants